#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# @Date : 2024/3/28 14:11
# @Author : water
# @Description : 基本练习


print("hello world!")


# 斐波那契数列是一个经典的数学问题，其中每个数字是前两个数字之和

def fib(n):
    """
    参数: n
    有中间变量
    """
    # 复合赋值
    a, b = 0, 1
    c = a + b
    print(a, b, end=" ")
    while c < n:
        print(c, end=' ')
        a, b = b, c
        c = a + b


def fib2(n):
    """
    参数：n
    无中间变量
    """
    a, b = 0, 1
    while b < n:
        print(b, end=' ')
        a, b = b, a + b


def fib3(n):
    """
    参数：n
    """
    a, b = 0, 1
    for _ in range(n):
        print(b, end=' ')
        a, b = b, a + b
        if b > 1000:
            break


for i in range(10):
    print(i)

a = [1, 2, 3, None, (), [], ]

print("长度", len(a))

if __name__ == '__main__':
    fib(100)
    print("\n")
    fib2(1000)
    print("\n")
    fib3(1000)
